#include <iostream>
using namespace std;

int BinaryStringToInt(const string& s)
{
	int ret = 0;
	int k = 0;
	auto iter = s.rbegin();
	while (iter != s.rend())
	{
		ret += (*iter - '0') * 2 ^ k++;
		++iter;
	}

	return ret;
}

int arr[10] = { 0x7e, 0x60, 0x6d, 0x79, 0x33, 0x5b, 0x5f, 0x70, 0x7f, 0x7b };

int main()
{
	string s1;
	while (cin >> s1)
	{
		int a = BinaryStringToInt(s1);
		for (int i = 0; i < 10; i++)
		{
			if()
		}

	}
	return 0;
}